<template>
  <div>
  <h1>{{message}}</h1>
  <button @click="revFn">点我翻转</button>
  </div>
</template>

<script>
export default {
  name: 'CodeApp',

  data() {
    return {
      message: 'HELLO,WORLD'
    };
  },

  mounted() {
    
  },

  methods: {
    revFn(){
      // 切割字符串成数组，翻转数组，将数组变成字符串
      // reverse会修改原数组
      this.message=this.message.split('').reverse().join('');
    }
  },
};
</script>

<style lang="scss" scoped>

</style>